package com.mdd.front.controller;

import com.mdd.common.aop.NotLogin;
import com.mdd.common.core.AjaxResult;
import com.mdd.front.service.INoticeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/notice")
public class NoticeController {

    @Resource
    INoticeService noticeService;

    @NotLogin
    @GetMapping("lists")
    public AjaxResult lists(){
         return AjaxResult.success(noticeService.lists());
    }

    @NotLogin
    @GetMapping("detail")
    public AjaxResult detail(@RequestParam("id") Integer id){
        return AjaxResult.success(noticeService.detail(id));
    }

}
